import com.zhuj.client.NrpcClient;
import com.zhuj.server.NrpcServer;
import org.junit.Test;

/**
 * Created by Administrator on 2018/1/3.
 */
public class App {

    @Test
    public void test01(){
        final NrpcServer server = new NrpcServer();
        /* 关闭测试
        Thread thread = new Thread(){
            @Override
            public void run() {
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                server.stop();
            }
        };
        thread.start();*/
        server.start(8080);
    }

    @Test
    public void test02(){
        NrpcClient client = new NrpcClient();
        client.start("127.0.0.1",8080);
        System.out.println("client---");
    }

    public static void main(String[] args) {
        NrpcServer server = new NrpcServer();
        server.start(8080);
        NrpcClient client = new NrpcClient();
        client.start("127.0.0.1",8080);
    }

}
